package dya318.graphics;

public class test {
    public static void main(String[] args) {
        //圆形面积
        Circle circle = new Circle();
        //传入半径r的值
        circle.setR(1);
        //定义一个doubel类型的圆形面积来接受返回值
        double circleArea = circle.calculated();
        System.out.printf("圆形面积为:%.2f\n",circleArea);

        //矩形面积
        Rectangle rectangle = new Rectangle();
        //设置长度
        rectangle.setLength(2);
        //设置宽度
        rectangle.setHeight(2);
        //定义一个double类型的变量来接收面积
        double rectangleArea = 0;
        rectangleArea = rectangle.calculated();
        System.out.println("矩形的面积为:"+rectangleArea);
    }
}
